<!DOCTYPE html>
<html>
<head>
<title>req_assign</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<link rel="stylesheet" type="text/css"
	href="/codebase/fonts/font_roboto/roboto.css" />
<link rel="stylesheet" type="text/css" href="/codebase/dhtmlx.css" />
 <script type="text/javascript" src="/codebase/dhtmlxform.js" />
<script type="text/javascript" src="/codebase/dhtmlxtabbar.js" /> 
<!--<script type="text/javascript" src="/codebase/dhtmlx.js" />-->
<style>


div#div_label1{	
	font-family: Roboto, Arial, Helvetica;
	font-size: 14px;
	color: #404040;
	overflow: auto;
	padding-left: 50px;
}

div#div_label2{	
	font-family: Roboto, Arial, Helvetica;
	font-size: 14px;
	color: #404040;
	overflow: auto;
	padding-left: 50px;
}

div#editorObj1 {
	width: 800px;
	height: 150px;
	border: 1px solid #dfdfdf;
}
div#editorObj2 {
	width: 800px;
	height: 150px;
	border: 1px solid #dfdfdf;
}

div#my_tabbar {
	width:900px;
	height: 1000px;
	border: 1px solid #dfdfdf;
}



</style>
<script>
	var myTabbar,myForm, myEditor1,myEditor2,myForm2,form_attach;
	var dhxWins ;
	var customCss = {
		video_bitrate : "validate_magenta",
		video_codec : "validate_orange"
	};
	
	function doOnLoad() {
		//alert("onload req assign");
		var v=document.getElementById("assign_req_id").innerHTML;
		if (myForm) {
			myForm.unload();
			myForm = null;
		}
		myForm = new dhtmlXForm("form_req_assign_details");
		//myForm.loadStruct("/common/testmanager/req_modify_detail.xml");
		myForm.loadStruct("/req/req_modify_detail_onload?req_id="+v);
		//tabbar
		var is_base_info=document.getElementById("is_base_info").innerHTML;
		var is_team_info=document.getElementById("is_team_info").innerHTML;
		var is_workload_info=document.getElementById("is_workload_info").innerHTML;
		var is_work_log_info=document.getElementById("is_work_log_info").innerHTML;
		
				myTabbar = new dhtmlXTabBar({
					parent: "my_tabbar",
					//close_button: true,
					//skin: skin,
					tabs: [
						{ id: "a1", text: "基本信息", active: true },
						{ id: "a2", text: "项目成员" },
						{ id: "a3", text: "工作量" },
						{ id: "a4", text: "工作日志" }
					]
				});	
				
				//myTabbar = new dhtmlXTabBar({parent: "my_tabbar"});
		//	if(is_base_info=="true"){
				//myTabbar.addTab("a1", "基本信息", null, null, true, false);
				myTabbar.tabs("a1").attachURL("/req/req_modify_detail_base_info?req_id="+v);	
			//}else{
			//	myTabbar.tabs("a1").hide("a4");
			//}
			
			
			/* //myToolbar = myTabbar.tabs("a1").attachToolbar();
			myToolbar_a1 = myTabbar.tabs("a1").attachToolbar({
				icons_path: "/common/imgs/",
				xml: "/common/testmanager/req_modify_detail_base_info_toolbar.xml"
			});		
			
			myToolbar_a1.attachEvent("onClick", function(id){
			    alert("click a1 btn");
			 // get frame
			    var ifr = myTabbar.tabs("a1").getFrame();
			 
			    // access to iframe's element
			    var elem = ifr.contentWindow.document.getElementsByName("form_req_base_info");
			    var dhxForm = elem.getForm();
			    dhxForm.send("/req/req_modify_detail_base_info_save",callback);
			    alert("elem :"+elem.innerHTML);
			}); */
			
			if(is_team_info=="true"){
				//myTabbar.addTab("a2", "项目成员", null, null, false, false);
				myTabbar.tabs("a2").attachURL("/req/req_modify_detail_team_info?req_id="+v);
			}else{
				myTabbar.tabs("a2").hide();
			}
			// 
			//myToolbar = myTabbar.tabs("a1").attachToolbar();
			/* myToolbar = myTabbar.tabs("a2").attachToolbar({
				icons_path: "/common/imgs/",
				xml: "/common/testmanager/req_modify_detail_base_info_toolbar.xml"
			});	 */
			
			if(is_workload_info=="true"){
				//myTabbar.addTab("a3", "工作量", null, null, false, false);
				myTabbar.tabs("a3").attachURL("/req/req_modify_detail_workload_info?req_id="+v);		
				
			}else{
				myTabbar.tabs("a3").hide();
			}
			// 
			//myToolbar = myTabbar.tabs("a3").attachToolbar();
			/* myToolbar = myTabbar.tabs("a3").attachToolbar({
				icons_path: "/common/imgs/",
				xml: "/common/testmanager/req_modify_detail_base_info_toolbar_new_save.xml"
			});	 */
			
			if(is_work_log_info=="true"){
				//myTabbar.addTab("a4", "工作日志", null, null, false, false);
				myTabbar.tabs("a4").attachURL("/req/req_modify_detail_work_log_info?req_id="+v);
			}else{
				myTabbar.tabs("a4").hide();
			}
			// 
			//myToolbar = myTabbar.tabs("a3").attachToolbar();
			/* myToolbar = myTabbar.tabs("a4").attachToolbar({
				icons_path: "/common/imgs/",
				xml: "/common/testmanager/req_modify_detail_base_info_toolbar_new_save.xml"
			});	 */

			myTabbar.attachEvent("onTabClick", function(id, lastId){
				 var ifr = myTabbar.tabs(id).getFrame();
				 ifr.contentWindow.doOnLoad();
				 
			   /* if(id=="a1"){
				   //myTabbar.tabs("a1").attachURL("/req/req_modify_detail_base_info?req_id="+v);
				   myTabbar.tabs("a1").reloadURL();
			   }
			   if(id=="a2"){
				  // myTabbar.tabs("a2").attachURL("/req/req_modify_detail_team_info?req_id="+v);
				   myTabbar.tabs("a2").reloadURL();
				   // get frame
				   // var ifr = myTabbar.cells("a2").getFrame();
				 
				   	 
				    // access to iframe's function
				    // make sure function is in the iframe's window scope
				    //ifr.contentWindow.doOnLoad();
				    
			   }
			   if(id=="a3"){
				  // myTabbar.tabs("a3").attachURL("/req/req_modify_detail_workload_info?req_id="+v);
				   myTabbar.tabs("a3").reloadURL();
			   }
			   if(id=="a4"){
				  // myTabbar.tabs("a4").attachURL("/req/req_modify_detail_work_log_info?req_id="+v);
				   myTabbar.tabs("a4").reloadURL();
			   } */
			});
		

		
	}
	

</script>
</head>
<body onload="doOnLoad();">
	<div id="assign_req_id" name="assign_req_id" th:text="${test_v}" style="display: none;"></div>
<div id="is_base_info" name="is_base_info" th:text="${is_base_info}" style="display: none;"></div>
<div id="is_team_info" name="is_team_info" th:text="${is_team_info}" style="display: none;"></div>
<div id="is_workload_info" name="is_workload_info" th:text="${is_workload_info}" style="display: none;"></div>
<div id="is_work_log_info" name="is_work_log_info" th:text="${is_work_log_info}" style="display: none;"></div>
	<table>
		<tr>
			<td>
				<div id="form_req_assign_details" ></div>
			</td>
		</tr>
	</table>
	<table>
		<tr>
			<td>
				<div id="my_tabbar" ></div>
			</td>
		</tr>
	</table>
	
</body>
</html>